<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>my_f</title>
</head>
<body>
<div> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;<b>我发布的朋友圈</b>&nbsp;&nbsp;&nbsp<a href="/app/yinchang">评论隐藏</a> </div>
<div id="content" style="margin: 0 auto">

</div>

<div id="ye"></div>
</body>
<script src="/static/js/jquery.min.js"></script>
<script>
    $(document).ready(function() {
        function qiu (mo) {
            $.ajax({
                url: mo,
                type: 'GET',
                dataType: 'JSON',
                {#data:{username:name, passwd:passwd},#}
                success: function (data) {
                    console.log(data);
                    if (data) {
                        for (var i = 0; i < data.results.length; i++) {
                            $("#content").append(
                                $("<div>").append(
                                    $('<li>').text("用户" + data.results[i].user_id),
                                    $('<img style="width:150px; height:150px">').attr("src", '/media/goods/images/' + data.results[i].image_name)
                                )
                            )
                        }
                    }

                    if (data.next) {
                        page = data.next.split('?')[1]
                        page = '/app/friends_q?'+ page
                        $("#ye").append(
                            $("<button>").text('下一页').on("click", function () {
                                $("#content").empty()
                                qiu(page)
                            }))
                    }
                },
                error: function (data) {
                    location.reload();
                }

            })

        }
    qiu('/app/friends_q')
    });

</script>
</html>